<template>
	<view class="app-container">
		<view class="logo">
			<text class="text">用户登录</text>
		</view>
		<view class="login">
			<button plain class="login-btn" @click="handleLogin">登录</button>
			<view class="agree">
				<u-checkbox-group @change="changeCheck">
					<u-checkbox v-model="checked" activeColor="#38dde5" shape="circle">
					</u-checkbox>
				</u-checkbox-group>
				<view class="label-txt">
					我已阅读并同意
					<navigator url="/pages/userAgree/userAgree">
						<text class="text-line">用户协议</text>
					</navigator>
					和
					<navigator url="/pages/privacy/privacy">
						<text class="text-line">隐私协议</text>
					</navigator>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				checked: false
			}
		},
		methods: {
			changeCheck() {
				this.checked = !this.checked
			},
			handleLogin() {
				// console.log(this.checked);
				if (this.checked) {
					uni.navigateTo({
						url: './index'
					});
				} else {
					uni.showToast({
						title: '请阅读并同意用户协议和隐私协议',
						icon: "none",
						duration: 2000
					});
				}
			}
		}
	}
</script>

<style lang="scss">
	@font-face{
		font-family: SourceHanSansCN-Normal;
		src: url("@/static/SourceHanSansCN-Normal.otf");
	}
	page {
		width: 100%;
		height: 100%;
		background-image: linear-gradient(to bottom, #111424, #90939b);
	}

	* {
		box-sizing: border-box;
	}
	.app-container{
		padding-top: 50px;
	}
	.logo {
		width: 100%;
		height: 200px;
		padding: 20px 40px;
		background: url("../../static/image/logo1.png") no-repeat;
		background-size: 100% auto;

		.text {
			background-image: linear-gradient(to right, #38dde5, #1891d6);
			-webkit-background-clip: text;
			color: transparent;
			font-family: SourceHanSansCN-Normal;
			font-size: 40px;
			font-weight: bold;
			line-height: 200px;
			letter-spacing: 5px;
			position: relative;
			top: 50px;
		}

		.text::after {
			content: "";
			position: absolute;
			top: -20px;
			left: 0;
			width: 50%;
			height: 4px;
			background-image: linear-gradient(to right, #38dde5, #1891d6);
			border-radius: 10px;
		}

		.text::before {
			content: "";
			position: absolute;
			bottom: -20px;
			left: 0;
			width: 150%;
			height: 4px;
			background-image: linear-gradient(to right, #38dde5, #1891d6);
			border-radius: 10px;
		}
	}

	.login {
		padding: 20px;
		width: 100%;
		height: 200px;
		position: absolute;
		bottom: 0;

		.login-btn {
			border-radius: 100px;
			border: none;
			color: #fff;
			letter-spacing: 5px;
			font-family: SourceHanSansCN-Normal;
			font-weight: 400;
			background-image: linear-gradient(to right, #38dde5, #1891d6);
		}

		.agree {
			display: flex;
			align-items: center;
			justify-content: center;
			margin-top: 20px;
			background-image: linear-gradient(to right, #38dde5, #1891d6);
			-webkit-background-clip: text;
			color: transparent;
			
			.label-txt{
				display: flex;
				align-items: center;
				justify-content: center;
			}
			
			.text-line{
				text-decoration: underline;
				border-bottom: 1rpx solid #38dde5
			}
		}
	}
</style>
